package org.spring.springboot.dao;

import org.apache.ibatis.annotations.Param;
import org.spring.springboot.domain.AdminMenu;

import java.util.List;

/**
 * 描述：菜单 DAO 接口类
 * <p>
 * Author: 赵新国
 * Date: 2017/10/12 14:48
 */
public interface MenuDao {

    /**
     * 用户拥有的菜单
     * @param userId
     * @param pid
     * @return
     */
    List<AdminMenu> getMenuListByUserId(@Param("userId") Short userId, @Param("pid") Short pid);

    /**
     * 获取所有菜单
     *
     * @return
     */
    List<AdminMenu> selectAllMenu(@Param("pid") Short pid);

    /**
     * 获取用户拥有菜单id的集合
     * @param userId
     * @return
     */
    List<Short> getMenuIdsByUserId(Short userId);

    AdminMenu selectByPrimaryKey(Short menuId);

    void updateByPrimaryKeySelective(AdminMenu adminMenu);

    void insertSelective(AdminMenu adminMenu);

    void deleteByPrimaryKey(Short menuId);
}
